package fr.lium.spkDiarization.example;

import fr.lium.spkDiarization.lib.MainTools;
import fr.lium.spkDiarization.libClusteringData.Cluster;
import fr.lium.spkDiarization.libClusteringData.ClusterSet;
import fr.lium.spkDiarization.libClusteringData.Segment;
import fr.lium.spkDiarization.parameter.Parameter;

public class ClusterSetTest {
	
	/**
	 * The main method.
	 * 
	 * @param args the arguments
	 * 
	 * @throws Exception the exception
	 */
	public static void main(String[] args) throws Exception {
			
		/*//set input and output segmentation parameters
		Parameter param = new Parameter();
		//set the input segmentation filename 
		param.parameterSegmentationInputFile.setMask("tempfile.in.seg");
		param.parameterSegmentationInputFile.setFormatEncoding("seg,UTF8");

		param.parameterSegmentationOutputFile.setMask("tempfile.out.seg");
		param.parameterSegmentationOutputFile.setFormatEncoding("seg,UTF8");
		*/
		
		//Second methode : get all parameters from the commande line
		Parameter param = MainTools.getParameters("ClusterSetTest", args);

		//read a segmentation file, the name of the file is in param.parameterSegmentationInputFile.mask
		ClusterSet clusters = MainTools.readClusterSet(param);
		
		for(Cluster cluster: clusters.clusterSetValue()) {
			for(Segment segment: cluster) {
				segment.debug(0);
			}
		}
		
		//write outputClusterSet
		MainTools.writeClusterSet(param, clusters);
	}
}
